package libcore.datastore

import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.stringPreferencesKey
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

class AppStore : AbsStore() {
    override val fileName: String
        get() = "app_store"

    suspend fun saveName(name: String) {
        saveData("name",name)
    }

    suspend fun getName() {
        withContext(Dispatchers.IO) {
            dataStore.edit {
                it[stringPreferencesKey("name")]
            }
        }
    }
}